package abstractFactory.custom;

import abstractFactory.itf.IKfcFactory;
import abstractFactory.model.Beverage;
import abstractFactory.model.ChickenWings;
import abstractFactory.model.FrenchFries;
import abstractFactory.model.Hamburg;

/**
 * 客户类
 *
 * @author laigl 2017年7月10日
 *
 */
public class Customer {

	private IKfcFactory kfcFactory;

	public Customer(IKfcFactory kfcFactory) {
		this.kfcFactory = kfcFactory;
	}

	public float orderHamburg(int num) {
		Hamburg hamburg = kfcFactory.createHamburg(num);
		hamburg.printMessage();
		return hamburg.totalPrice();
	}

	public float orderChickenWings(int num) {
		ChickenWings chickenWings = kfcFactory.createChickenWings(num);
		chickenWings.printMessage();
		return chickenWings.totalPrice();
	}

	public float orderFrenchFries(int num) {
		FrenchFries frenchFries = kfcFactory.createFrenchFries(num);
		frenchFries.printMessage();
		return frenchFries.totalPrice();
	}

	public float orderBeverage(int num) {
		Beverage beverage = kfcFactory.createBeverage(num);
		beverage.printMessage();
		return beverage.totalPrice();
	}

}
